#
#
#
INCLUDE =  "include"
INCLUDE2 = "../include/epgsql-master/include"
INCLUDE3 = "../include/msgpack-erlang-master/include"

MODS= clients mainEntry dbtest utils log msg session
ERLC = erlc -W0 -I ${INCLUDE} -I ${INCLUDE2} -I ${INCLUDE3} -o "ebin"


all:compile
compile: ${MODS:%=%.beam}

clients.beam:src/clients.erl
	${ERLC} src/clients.erl

mainEntry.beam:src/mainEntry.erl 
	${ERLC} src/mainEntry.erl
dbtest.beam:src/dbtest.erl
	$(ERLC) src/dbtest.erl

dbtest.beam:src/dbtest.erl
	$(ERLC) src/dbtest.erl

utils.beam:src/utils.erl
	$(ERLC) src/utils.erl
log.beam:src/log.erl
	$(ERLC) src/log.erl
msg.beam:src/msg.erl
	$(ERLC) src/msg.erl
session.beam:src/session.erl
	$(ERLC) src/session.erl

clean:
	rm -rf ebin/*.beam ebin/*.bak erl_crash.dump
	
cls:
	cls
mnesia:
	erl -mnesia dir '"/usr/local/gamesvr/mnesia"'
run:
	erl +K true +Q 1000000 +P 1000000 +S 4 -smp enable -mnesia dir '"DB"'  -pa "../include/epgsql-master/ebin"  \
	-pa "../include/msgpack-erlang-master/ebin" -pa "ebin"   -run mainEntry start start
